# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=greenbone-feed-sync
# follow the same version of gvm-tools
pkgver=23.10.0
pkgrel=0
pkgdesc="New script for syncing the Greenbone Community Feed"
url="https://github.com/greenbone/greenbone-feed-sync"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	py3-rich
	python3
	rsync
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-poetry-core
	py3-lxml
	"
checkdepends="
	py3-pontos
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/greenbone-feed-sync/archive/refs/tags/v$pkgver.tar.gz"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
fe5864c4e650f17a072cd6e4153779ea33ad8f0ac28e92114b40c465a04b70791b603ccbe82934dcdad13fce2003e2d9786cec75854efecf8aefa74c7ce178f4  greenbone-feed-sync-23.10.0.tar.gz
"
